package com.dongrj.framework.web.utils;

import lombok.Getter;
import lombok.Setter;
import org.springframework.http.ResponseEntity;

/**
 * @author dongrongjun
 * @date 2021/03/24
 */
@Setter
@Getter
public class MarketResponseEntity<T> {

    // 请求结果
    private ResponseEntity<T> responseEntity;

    // 请求url
    private String url;

    // 请求参数
    private String param;

    // 请求是否失败
    private boolean error = false;

    // 异常
    private Exception exception;

    public MarketResponseEntity(String url) {
        this.url = url;
    }

    public MarketResponseEntity(String url, String param) {
        this.url = url;
        this.param = param;
    }

    public void setException(Exception exception) {
        this.error = true;
        this.exception = exception;
    }
}
